//TODO - overload draw method to enable drawing multiple cards and returning a list of cards


package cards;

import java.util.ArrayList;
import java.util.Collections;


public class Deck {

	ArrayList<Card> deck = new ArrayList<Card>();
	
	public Deck() {
		for (int suit = 0; suit<=3; suit ++) {
			for (int rank = 1; rank <=13 ; rank++) {
				deck.add(new Card(suit, rank));
			}
		} 
		this.shuffle();
	}
	
	public int deckLength() {
		return this.deck.size();
	}
	
	public void shuffle() {
		Collections.shuffle(deck);	
	}
	
	public Card draw() {
		Card drawn = (Card) deck.get(0);		
		deck.remove(0);		
		return drawn;		
	}
	
	public Card[] draw(int n) {
		Card[] drawnCards = new Card[n];
		for(int i=0; i<n; i++) {
			Card drawn = (Card) deck.get(0);
			drawnCards[i] = drawn;		
			deck.remove(0);	
		}
		return drawnCards;
	}
	

	
}
